home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / FROMUTS / UNIXLIB37B / src / c / abs < prev    next >
Text File  |  1990-09-27  |  430b  |  30 lines

  1. #ifdef __STDC__
  2. static char sccs_id[] = "@(#) abs.c 1.1 "__DATE__" HJR";
  3. #else
  4. static char sccs_id[] = "@(#) abs.c 1.1 26/9/90 HJR";
  5. #endif
  6.  
  7. /* abs.c (c) Copyright 1990 H.Rogers */
  8.  
  9. #include <stdlib.h>
  10.  
  11. #ifdef __STDC__
  12. int abs(register int x)
  13. #else
  14. int abs(x)
  15. register int x;
  16. #endif
  17. {
  18. return((x < 0) ? -x : x);
  19. }
  20.  
  21. #ifdef __STDC__
  22. long labs(register long x)
  23. #else
  24. long labs(x)
  25. register long x;
  26. #endif
  27. {
  28. return((x < 0) ? -x : x);
  29. }
  30.